<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateManagerTable extends Migration
{
    public function up()
    {
        //管理员表
        Schema::create('manager', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username',20)->unique()->comment('用户名');
            $table->string('password')->comment('密码');
            $table->string('nick_name',20)->nullable()->comment('昵称');
            $table->string('mobile',13)->unique()->nullable()->comment('手机');         //->unique()
            $table->string('email',50)->unique()->nullable()->comment('邮箱');          //->unique()
            $table->string('avatar')->nullable()->comment('用户头像');
            $table->unsignedTinyInteger('status')->default(2)->comment('1禁止,2正常');
            $table->ipAddress('last_ip')->nullable()->comment('最后登录IP');
	        $table->unsignedInteger('login_count')->nullable()->comment('登录次数');
            $table->timestamp('last_login')->nullable()->comment('最后登录时间');
            $table->boolean('deleted')->default(false)->comment('删除');
            $table->rememberToken()->comment('记住登录状态');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('manager');
    }
}
